/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ultrasoft.farmasoft.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Administrador
 */
@Embeddable
public class UserpharmacyPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "pharmacyId")
    private int pharmacyId;
    @Basic(optional = false)
    @Column(name = "userId")
    private int userId;

    public UserpharmacyPK() {
    }

    public UserpharmacyPK(int pharmacyId, int userId) {
        this.pharmacyId = pharmacyId;
        this.userId = userId;
    }

    public int getPharmacyId() {
        return pharmacyId;
    }

    public void setPharmacyId(int pharmacyId) {
        this.pharmacyId = pharmacyId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) pharmacyId;
        hash += (int) userId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserpharmacyPK)) {
            return false;
        }
        UserpharmacyPK other = (UserpharmacyPK) object;
        if (this.pharmacyId != other.pharmacyId) {
            return false;
        }
        if (this.userId != other.userId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ultrasoft.farmasoft.domain.UserpharmacyPK[ pharmacyId=" + pharmacyId + ", userId=" + userId + " ]";
    }
    
}
